#include<bits/stdc++.h>
using namespace std;
int main()
{
	char a[1000];
	int zi=0,shu=0,kong=0,qi=0,i;
	gets(a);
	for(i=0;i<strlen(a);i++)
	{
		if((97<=a[i]&&a[i]<=122)||(65<=a[i]&&a[i]<=90)) zi++;
		else if(48<=a[i]&&a[i]<=57) shu++;
		else if(a[i]==32) kong++;
		else qi++;
	}
	printf("%d %d %d %d",zi,shu,kong,qi);
    return 0;
}
